package com.modebing.activiti7.listener;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyListener implements TaskListener {

    /**
     * 监听器出发的方法
     * @param delegateTask
     */
    @Override
    public void notify(DelegateTask delegateTask) {
        if (EVENTNAME_CREATE.equals(delegateTask.getEventName())){
            //表示当前的创建事件被触发了
            delegateTask.setAssignee("zhangsan");
        }
        System.out.println("==============自定义了监听器==============");
    }
}
